for a in range(1, 10000):
    ge = a % 10
    shi = a // 10 % 10
    bai = a // 100 % 10
    qian = a // 1000 % 10
    if ge!=1 and shi!=2 and bai!=3 and qian!=4:
      print(a)
